package cn.yunhe.biz;

import java.util.List;

import cn.yunhe.dao.INewsDao;
import cn.yunhe.dao.NewsDaoImpl;
import cn.yunhe.dao.NewsDaoImplByMybatis;
import cn.yunhe.model.News;

public class NewsBizImpl implements INewsBiz {
	INewsDao newsDao=new NewsDaoImpl();
	
	public boolean addNews(News news) {
		int flag=newsDao.addNews(news);
		
		if(flag>0){
			return true;
		}else{
			return false;
		}
		
	}

	
	public List<News> getALLnew() {
		INewsDao newsDaoMybatis=new NewsDaoImplByMybatis();
		return newsDaoMybatis.getAllNews();
	}


	
	public News getNewsById(int nid) {
		
		return newsDao.getNewsById(nid);
	}

}
